package exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        try{

            //String str = null;
            //System.out.println(str.length());
            //String str = "abc";
            //System.out.println(str.charAt(5));
            String str = "abc";
            System.out.println(Integer.parseInt(str));

            System.out.println("!!!");
        }
        /*catch(NullPointerException e){
            System.out.println("出现了空指针,并处理完了");
        }catch(StringIndexOutOfBoundsException e){
            System.out.println("出现了字符串下标越界异常,并处理完了");
         */
        catch (NullPointerException|StringIndexOutOfBoundsException e){
            System.out.println("出现了空指针和越界异常,并处理了");
        }catch(Exception e){
            System.out.println("我不管,已经处理了");
        }
        System.out.println("运行结束!");
    }
}
